package com.jt;

import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;

import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;

@SpringBootApplication
@EnableFeignClients
public class SystemServerApplication implements ApplicationRunner {

    public static void main(String[] args) {
        SpringApplication.run(SystemServerApplication.class, args);
    }

    @Override
    public void run(ApplicationArguments args) throws Exception {
        String path = "C:\\Users\\34241\\Desktop\\weibang";
        Path directory = Paths.get(path);
        try {
            if (Files.exists(directory)) {
                System.out.println("目录存在，可以访问。");
            } else {
                System.out.println("目录不存在。");
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
